package com.example.news;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import androidx.appcompat.app.AppCompatActivity;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        Handler handler = new Handler();
        handler.postDelayed (new Runnable () {    //匿名内部类  创建线程
            @Override
            public void run() {
                startActivity (new Intent(Main2Activity.this,MainActivity.class));      //界面转跳
            }
        },3000);         //第二个参数是停留的时间
    }


}
